// 调用翻译相关API

import axios from "../apiWrapper"
import {hex_md5} from "@/js/_MD5"


export const translate = (q) => {
    let baseURL = "http://localhost:8081/baidufanyi/api/trans/vip/translate";

    let from = "en";
    let to = "zh";
    let appid = "20220409001165196";
    let key = "cXRYjyc76iqXWaaS0rhO";
    let salt = "12345678";
    let sign = hex_md5(appid+q+salt+key);

    return axios.get(baseURL,{
        params:{
            q:q,
            from:from,
            to:to,
            appid:appid,
            salt:salt,
            sign:sign,
        }
    })
};